#ifndef _RENDER_H_
#define _RENDER_H_

#include "widget/widget.h"


typedef struct{
    uint8_t w,h;
    uint8_t* gui_ram;
    uint8_t ram_w,ram_h;
    widget_t* render_obj;
}render_t;

typedef struct{
    uint8_t w,h;
    uint8_t* gui_ram;
}render_gram_desc_t;

void render_init(may_screen_t* screen);
void render_main_loop(void);
render_gram_desc_t render_get_gram(void);


//渲染基础函数
void render_draw_text(int x, int y, const char *text);
void render_draw_img(int x, int y, int w, int h, const uint8_t *img);
void render_draw_rounded_rect(int x, int y, int w, int h, int r);
void render_draw_circle(int x, int y, int r);
void render_draw_pixel(int x, int y);
void render_draw_rect(int x, int y, int w, int h);

//渲染器操作函数
void render_widget_func_register(widget_type_e type, widget_render_func func);
void render_widget(widget_t *widget);

#endif